//
// Created by Castle on 2025/10/22.
//

using namespace std;

#include <iostream>
#include <ctime>


int main() {

    srand(time(0));

    char prediction0[]{"you laughing your lungs out.I've never seen this before"};
    char prediction1[]{"a lot of kinds running in the backyard!"};
    char prediction2[]{"a lot of empty beer bootles on your work table."};
    char prediction3[]{"you Partying too much with kids wearing weird clothes."};
    char prediction4[]{"you running away from something really scary"};
    char prediction5[]{"clouds gathering in the sky and an army standing ready for"};
    char prediction6[]{"dogs running around in a deserted empty city"};
    char prediction7[]{"a lot of cars struck in a terrible traffic jam"};
    char prediction8[]{"you sitting in the dark typing lots of lines of code on your"};
    char prediction9[]{"you yelling at your boss.And oh no!You get fired"};


    bool end {false};
    const int max_length {15};
    const char name [max_length]{};

    cout << "What's your name dear: " << endl;
    cin.getline(name,max_length);

    while (!end) {
        cout << "Oh dear " << name <<  " I see" << endl;

        size_t rand_num = static_cast<size_t>((rand() % 11));

        switch (rand_num) { //[0~10]
            case 0:
                cout << prediction0 << endl;
                break;
            case 1:
                cout << prediction1 << endl;
                break;
            case 2:
                cout << prediction2 << endl;
                break;
            case 3:
                cout << prediction3 << endl;
                break;
            case 4:
                cout << prediction4 << endl;
                break;
            case 5:
                cout << prediction5 << endl;
                break;
            case 6:
                cout << prediction6 << endl;
                break;
            case 7:
                cout << prediction7 << endl;
                break;
            case 8:
                cout << prediction8 << endl;
                break;
            case 9:
                cout << prediction9 << endl;
                break;
            default:
                cout << ", huum,I don't see anything." << endl;

        }
        cout << "Do you want me to try again ? (Y | N)";

        char go_on;
        cin >> go_on;

        end = ((go_on == 'Y') || (go_on == 'y')) ? false : true;
    }

    cout << "That's all I have today.Best wishes!" << endl;

    return 0;
}